package com.example.mybatisplus.config;

import com.example.mybatisplus.interceptor.loginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created with IntelliJ IDEA.
 * User: lixiao
 * Created Date: 2020/9/24 17:19
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration interceptor = registry.addInterceptor(new loginInterceptor());
        interceptor.addPathPatterns("/**")
                .excludePathPatterns("/htmltest/login"
                        , "/htmltest/error"
                ).order(1);
    }
}